package com.wwtech.epp.ui.activity.friend.module;

import com.wwtech.epp.contain.ContainValue;
import com.wwtech.epp.data.api.HttpAPIWrapper;
import com.wwtech.epp.ui.activity.base.ActivityScope;
import com.wwtech.epp.ui.activity.friend.AddPersonActivity;
import com.wwtech.epp.ui.activity.friend.contract.AddPersonContract;
import com.wwtech.epp.ui.activity.friend.presenter.AddPersonPresenter;
import com.wwtech.epp.ui.adapter.main.CheckPersonAdapter;

import dagger.Module;
import dagger.Provides;

/**
 * @author hzp
 * @Package com.wwtech.epp.ui.activity.friend
 * @Description: The moduele of AddPersonActivity, provide field for AddPersonActivity
 * @date 2017/09/12 23:05:17
 */
@Module
public class AddPersonModule {
    private final AddPersonContract.View mView;


    public AddPersonModule(AddPersonContract.View view) {
        this.mView = view;
    }

    @Provides
    @ActivityScope
    public AddPersonPresenter provideAddPersonPresenter(HttpAPIWrapper httpAPIWrapper, AddPersonActivity mActivity) {
        return new AddPersonPresenter(httpAPIWrapper, mView, mActivity);
    }

    @Provides
    @ActivityScope
    public AddPersonActivity provideAddPersonActivity() {
        return (AddPersonActivity) mView;
    }

    @Provides
    @ActivityScope
    public CheckPersonAdapter provideCheckPersonAdapter() {
        return new CheckPersonAdapter(ContainValue.userList);
    }
}